text-view: make measure() use the layout height
authorPeter Bloomfield <PeterBloomfield@bellsouth.net>
Wed, 21 Feb 2018 13:22:42 +0000 (08:22 -0500)
committerPeter Bloomfield <PeterBloomfield@bellsouth.net>
Wed, 21 Feb 2018 13:22:42 +0000 (08:22 -0500)
GtkTextView::measure should include the height of the text-layout in its
minimum and natural heights. This fixes scrolling when a text-view has a
scrolled-window ancestor that is not its immediate parent.

gtk/gtktextview.c

index 85f2207d38e5912932a9f08a710327bafc1385d0..8abb165e97c272e89215d43b0e81da2c2490e2cf 100644 (file)
@@ -3905,7 +3905,7 @@ gtk_text_view_measure (GtkWidget      *widget,
   else /* orientation == VERTICAL */
     {
       min += priv->border_window_size.top + priv->border_window_size.bottom;
-      min += priv->top_margin + priv->bottom_margin;
+      min += priv->height;
     }
 
   nat = min;
@@ -4447,6 +4447,7 @@ changed_handler (GtkTextLayout     *layout,
 
           tmp_list = tmp_list->next;
         }
+      gtk_widget_queue_resize_no_redraw(widget);
     }
 }